import { _HttpClient } from '@delon/theme';
import { Injectable } from '@angular/core';
import { HttpParams, HttpHeaders } from '@angular/common/http';
import { environment } from '../../../../../environments/environment';
const responseHeaders = new HttpHeaders().set('Content-Type', 'application/json;charset=UTF-8');

@Injectable({ providedIn: 'root' })

export class TctjMonthService {

    constructor(private http: _HttpClient) { }
    /**
     * 查询
     * @param param	String monthStr; 格式 yyyyMM（201911）
     */
    query(param) {
        const dataurl = environment.project + '/skywinStat/monthStat';
        return this.http.post(dataurl, '', param, { headers: responseHeaders });
    }
    /**
     * 查询某一项统计信息详情
     * @param params skywinType
     * @param params line
     * @param params monthStr
     * @param params detailType 明细内容查看类型
     * 申请兑现情况 申请 A
     * 申请兑现情况 列入计划 B
     * 计划兑现情况 计划 C
     * 计划兑现情况 兑现 D
     */
    detail(params) {
        const dataurl = environment.project + '/skywinStat/monthStatDetail';
        return this.http.post(dataurl, '', params, { headers: responseHeaders });
    }
    /**
     * 展开
     * @param params workdateStart
     * @param params workdateEnd
     * @param params workshop 车间
     * @param params workarea 工区
     */
    test(params) {
        const dataurl = environment.project + '/skywinStat/dayStatExport';
        return this.http.post(dataurl, '', params, { headers: responseHeaders, responseType: 'blob' });
    }

}
